package com.foreveross.vo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.foreveross.vo.common.AffiliatedBaseVo;

@Entity
@Table(name = "sys_code_house", catalog = "hrtenement")
public class SysCodeHouse implements java.io.Serializable {

	private String id;
	private HrHouses hrHouses;
	private HrCode hrCode;

	@Id
	@GenericGenerator(name = "idGenerator", strategy = "uuid")
	@GeneratedValue(generator = "idGenerator")
	@Column(name = "id", unique = true, nullable = false, length = 32)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "house_id")
	@NotFound(action=NotFoundAction.IGNORE)
	public HrHouses getHrHouses() {
		return hrHouses;
	}

	public void setHrHouses(HrHouses hrHouses) {
		this.hrHouses = hrHouses;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "code_id")
	@NotFound(action = NotFoundAction.IGNORE)
	public HrCode getHrCode() {
		return hrCode;
	}

	public void setHrCode(HrCode hrCode) {
		this.hrCode = hrCode;
	}

}
